package com.tanhua.manage.controller;

import com.tanhua.manage.service.AnalysisByDayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/dashboard")
public class AnalysisController {


    @Autowired
    private AnalysisByDayService analysisByDayService;

    /**
     *接口名称：概要统计信息
     * =接口路径：GET/dashboard/summary
     */
    @GetMapping("/summary")
    public ResponseEntity  summary(){
        return analysisByDayService.summary();
    }
    /**
     *接口名称：新增、活跃用户、次日留存率
     *接口路径：GET/dashboard/users
     *  101 新增 102 活跃用户 103 次日留存率
     */
    @GetMapping("/users")
    public ResponseEntity  statistics(Long sd,Long ed,Integer type){
        return analysisByDayService.statistics(sd,ed,type);

    }
}
